<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" />
    <!-- 全屏 -->
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <!-- 上方栏显示 -->
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />
    <!-- 不自动识别号码 -->
    <meta name="format-detection" content="telephone=no">
    <!-- Include js plugin -->
    <title>登录注册</title>
    <link rel="stylesheet" href="/static/wap/skin/css/layout.css">
    <link rel="stylesheet" href="/static/wap/skin/css/demos.css">
    <link rel="stylesheet" href="/static/wap/skin/css/logreg.css">
    
    <link rel="stylesheet" href="/static/wap/weui/css/weui.min.css">
    <link rel="stylesheet" href="/static/wap/weui/css/jquery-weui.min.css">
    <script src="/static/wap/weui/js/jquery.min.js"></script>
    <script src="/static/wap/weui/js/jquery-weui.min.js"></script>
    <script src="/static/wap/skin/js/demos.js"></script>
</head>
<body>
<header class="brB">
	<div class="h_top">
    	<div class="hLeft"><a href="javascript:;" class="icoH icoReturn mt20"></a></div>
    	<div class="hCenter"><span class="tit c-3ac9af">登录注册</span></div>
    </div>
</header>
<div class="warp">
    <div class="xlcss-form-dome">
    <form action="/logreg/next/<{$phone}>?openid=<{$open_id}>" method="post">
        <ul>
            <{if $phone_has == 0}>
            <li >
                <div class="layout-box <{if isset($vcode_err)}>layError<{else}>layAccur<{/if}>">
                    <div class="box-col"><input class="noText" maxlength="4" name="vcode" type="text" placeholder="验证码"></div>
                    <div class="ptb10">
                        <a class="de_code send-msg" href="javascript:;" hasclick="1">获取验证码</a>
                    </div>
                     <{if isset($vcode_err)}>
                    <div class="icoWrong">!</div>
                    <{else}>
                    <!-- <div class="icoWrong">&rfloor;</div> -->
                    <{/if}>
                </div>
            </li>
            <{/if}>
            <li>
                <div class="layout-box <{if isset($password_err)}>layError<{else}>layAccur<{/if}>">
                    <div class="box-col"><input class="noText" name="password" type="password" placeholder="输入登录密码"></div>
                    <{if isset($password_err)}>
                    <div class="icoWrong">!</div>
                    <{else}>
                    <!-- <div class="icoWrong">&rfloor;</div> -->
                    <{/if}>
                </div>
            </li>
            
        </ul>
        <div class="de_btn">
            
            <button>登录注册</button>
           
        </div>
        </form>
    </div>
    
</div>

<script type="text/javascript">
    $(function ($) {
        if("<{$password_err|default:''}>" != ''){
            alert("登录密码错误");
        }
        var countdown = 5;
        //发送短信验证码
        $(".send-msg").click(function(){
            var obj = $(this);
            var linkPhone = "<{$phone}>";
            if(linkPhone==""||linkPhone==undefined){
                alert("请填写手机号");
                $("#phone").focus();
                return;
            }else{
                var hasClick = $(obj).attr("hasclick");
                if (hasClick == 1) {
//                    alert("开始获取验证码");
                    countdown = 60;
                    $.ajax({
                        url:"/reg/reg_msg/"+linkPhone,
                        type:"post",
                        dataType:"json",
                        success:function(res){
                            if(res.code==201){
                                $("#pwd_li").remove();
                                settime(obj);
                            } else if (res.code == 200) {
                                alert("短信发送成功！请注意查收！");
                                settime(obj);
                            }else{
                                alert(res.msg);
                            }
                        }
                    });
                }
            }

        });


        function settime(val) {
            if (countdown == 0) {
                //                $(val).removeAttribute("disabled");
                $(val).attr("hasclick", "1");
                $(val).text("免费获取验证码");
            } else {
                $(val).attr("hasclick", "0");
                //                $(val).("disabled", true);
                $(val).text("重新发送(" + countdown + ")");
                countdown--;
                setTimeout(function () {
                    settime(val)
                }, 1000);
            }
        }

    });
</script>
</body>
</html>